package com.huichaoliu.netUtils;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONException;
import org.json.JSONObject;

import com.ta.util.http.AsyncHttpClient;
import com.ta.util.http.AsyncHttpResponseHandler;

public class ResultUtils {

	AsyncHttpClient asyncHttpClient = new AsyncHttpClient();

	String reply = "";
	String noteId = "";
	String userId = "";

	public ResultUtils() {
		// 用法就是这样:
		asyncHttpClient.post(UrlUtils4Stl.getURL("notecommentreply"),
				ParamsUtils.notecommentreply(userId, noteId, reply), new AsyncHttpResponseHandler() {

					// 开始请求 ,可以不写,删掉也没事
					@Override
					public void onStart() {
						super.onStart();
					}

					// 完成请求 ,可以不写,删掉也没事
					@Override
					public void onFinish() {
						super.onFinish();
					}

					// 请求成功返回数据
					@Override
					public void onSuccess(int statusCode, String content) {
						super.onSuccess(statusCode, content);
					}

					// 请求失败
					@Override
					public void onFailure(Throwable error, String content) {
						super.onFailure(error, content);
					}
				});
	}

	/**
	 * 从json中获取 (6.6求救贴评论)
	 * 
	 * @param json
	 * @return
	 */
	public static List<Stylist_PingLun> get_noteaddcomment(String json) {
		List<Stylist_PingLun> list = new ArrayList<Stylist_PingLun>();
		Stylist_PingLun pingLun;
		try {
			JSONObject jo = new JSONObject(json);
			pingLun = new Stylist_PingLun();
			pingLun.setImage("");
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
	}
}
